import request from "../../service/request";

const addArticle = (data={}) => {
  return request({
    method: "POST",
    url: "/api/article",
    data: data
  })
}

const getArticleList = () => {
  return request({
    method: "GET",
    url: "/api/article",
  })
}

const getArticle = (id) => {
  return request({
    method: "GET",
    url: `/api/article/${id}`
  })
}

const updateArticle = (data={}) => {
  return request({
    method: "PUT",
    url: "/api/article",
    data: data
  })
}

export {
  addArticle,
  getArticleList,
  getArticle,
  updateArticle
}